package foodmaterial.action.valid;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.List;

public class ListLengthValidator implements ConstraintValidator<ListLengthValid, List> {

    @Override
    public void initialize(ListLengthValid constraintAnnotation) {

    }

    @Override
    public boolean isValid(List value, ConstraintValidatorContext constraintValidatorContext) {
        if (value == null || value.isEmpty()) return false ;
        return true;
    }

}
